//== SAGITTARIUS ============================================================================

//== FILEDOC =========================================================================

/** @file set_uint64.h
  * @brief Set implementation for mpz_t
  */

//== BEGINNING OF CODE ===============================================================

#ifndef __SAGUTTARUIS__SET_UINT64__H_
#define __SAGUTTARUIS__SET_UINT64__H_

//== INCLUDES ========================================================================

#include "sagittarius/core/SagittariusCore.h"

#define HASH_COLLISION 1
#define HASH_SUCCESS   0

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    uint64 n;
    uint64 depth;
    uint64* e;
} set_uint64_bucket;

typedef struct {
    uint64 nbuckets;
    set_uint64_bucket* buckets;
} set_uint64;

int set_uint64_check(set_uint64* ht, uint64 p);

int set_uint64_insert(set_uint64* ht, uint64 p);

/** @brief Returns a number not already in the set
 */
uint64 set_uint64_make_unique(set_uint64* ht);

set_uint64* set_uint64_rehash(set_uint64* ht, uint64 nbuckets, uint64 depth);

void set_uint64_destroy(set_uint64* h);

void set_uint64_dumpstate(int fd, set_uint64* h);

#ifdef __cplusplus
}//extern "C"
#endif

#endif
